#pragma once

#include <QPushButton>
#include "ui_ToolBar.h"

class MyButton;

class ToolBar : public QWidget {
	Q_OBJECT

public:
    ToolBar(QWidget* parent = nullptr);
    ~ToolBar();
signals:
    void moveMainWindow(QPoint point);
    void closeMainWindow();
protected:
    // 鼠标移动事件
    void mouseMoveEvent(QMouseEvent* ev) override;
    // 鼠标按下事件
    void mousePressEvent(QMouseEvent* ev) override;
    // 鼠标释放事件
    void mouseReleaseEvent(QMouseEvent* ev) override;

protected slots:
    void clickCloseButton();
private:
    Ui::ToolBar m_ui;


    QPoint* m_point = nullptr;
	MyButton* m_closeWindowButton = nullptr;

    void clearPoint();
};
